//
//  Consume_ScreenCollectionViewCell.m
//  JinFuThree
//
//  Created by 爱尚 on 2018/9/3.
//  Copyright © 2018年 毛韶谦. All rights reserved.
//

#import "Consume_ScreenCollectionViewCell.h"

@implementation Consume_ScreenCollectionViewCell

-(instancetype)initWithFrame:(CGRect)frame{
    self = [super initWithFrame:frame];
    if (self) {
        self.backgroundColor = ListMaoBackgroundColor;
        [self initialize];
    }
    return self;
}

-(void)initialize{
    
    UIView *backView = [[UIView alloc]init];
    backView.backgroundColor = [UIColor whiteColor];
    [self addSubview:backView];
    [backView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.mas_top).offset(5);
        make.right.mas_equalTo(self.mas_right).offset(-5);
        make.bottom.left.mas_equalTo(self);
    }];
    
    _iconImageView = [[UIImageView alloc]init];
    _iconImageView.image = [UIImage imageNamed:@"小米"];
    [self addSubview:_iconImageView];
    [_iconImageView mas_makeConstraints:^(MASConstraintMaker *make) {
        make.top.mas_equalTo(self.mas_top).offset(10);
        make.left.mas_equalTo(self.mas_left).offset(18);
        make.right.mas_equalTo(self.mas_right).offset(-18);
        make.height.mas_equalTo(self.iconImageView.mas_width);
    }];
    
    _titleLabel = [[UILabel alloc]init];
    _titleLabel.text = @"小米";
    _titleLabel.textAlignment = NSTextAlignmentCenter;
    _titleLabel.textColor = HexColor(0x666666);
    _titleLabel.font = [UIFont systemFontOfSize:12];
    [self addSubview:_titleLabel];
    [_titleLabel mas_makeConstraints:^(MASConstraintMaker *make) {
        make.left.mas_equalTo(self.mas_left).offset(8);
        make.right.mas_equalTo(self.mas_right).offset(-8);
        make.top.mas_equalTo(self.iconImageView.mas_bottom).offset(8);
    }];
}

@end
